using System.ComponentModel.DataAnnotations;
using Models;

namespace Models
{
    /// <summary>
    /// 角色权限关联实体类，用于维护角色和权限之间的多对多关系
    /// </summary>
    public class RolePermission
    {
        /// <summary>
        /// 角色权限关联ID，主键
        /// </summary>
        public int RolePermissionId { get; set; }

        /// <summary>
        /// 角色ID，外键
        /// </summary>
        public int RoleId { get; set; }

        /// <summary>
        /// 权限ID，外键
        /// </summary>
        public int PermissionId { get; set; }
        
        /// <summary>
        /// 关联的角色实体，必填
        /// </summary>
        [Required]
        public virtual Role Role { get; set; } = null!;

        /// <summary>
        /// 关联的权限实体，必填
        /// </summary>
        [Required]
        public virtual Permission Permission { get; set; } = null!;
    }
} 